<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <title>layui</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="/lib/layui-v2.5.5/css/layui.css" media="all">
    <link rel="stylesheet" href="/css/public.css" media="all">
    <style>
        body {
            background-color: #ffffff;
        }
    </style>
</head>
<body>
<form class="layui-form" >
<div class="layui-form layuimini-form">
    <div class="layui-form-item">
        <label class="layui-form-label required" >用户名</label>
        <div class="layui-input-block">
            <input type="hidden" id="list" th:value="${param.selectlist}">
            <input type="text" id="password" placeholder="Password:" value="" class="layui-input">
            <tip>填写重置密码。</tip>
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn layui-btn-normal" lay-submit lay-filter="saveBtn">确认保存</button>
        </div>
    </div>
<!--    <input type="hidden" id="roleIdArray" th:value="${roleIdList}">-->

    </div></form>
<script src="/lib/layui-v2.5.5/layui.js" charset="utf-8"></script>
<script>
    layui.use(['form'], function () {
        var form = layui.form,
            layer = layui.layer,
            $ = layui.$;

        //监听提交
        form.on('submit(saveBtn)', function (data) {
            var list=[];
            list = $("#list").val();
             alert(list)
            var password = $("#password ").val();
              alert(password)
             $.post({
                 url:"/resetUserPassword?password="+password +"&list="+list,
                 type:"post",
                 success:function (data) {
                     if(data==1){
                     layer.msg("重置成功")
                     }else{
                         layer.msg("重置失败")
                     }
                 }
            })
        });

            return false;

    });


</script>
</body>
</html>